// Copyright (C) joyinter
// All rights reserved.
// 
// Author : dengxinguo
// Date   : 2004-12-28
  
#ifndef __PROXYWND_H_CLIENT_MAIN__
#define __PROXYWND_H_CLIENT_MAIN__

#pragma once

#include <client/main/resource.h>
#include <common\ui\wnd.h>
#include <common\ui\button.h>
#include <common\ui\imagectrl.h>
#include <common\ui\label.h>
#include <common\ui\checkbox.h>
#include <common\ui\edit.h>

//##ModelId=44C4B5E402CE
class CJoyProxyWnd :
    public CJoyWnd
{
	DECLARE_DYNAMIC(CJoyProxyWnd)
private:
	
	//##ModelId=44C4B5E402D1
	CJoyEdit*   m_ProxyIP;
	//##ModelId=44C4B5E402DF
    CJoyEdit*   m_ProxyPort;
	//##ModelId=44C4B5E402E4
    CJoyEdit*   m_username;
	//##ModelId=44C4B5E402E9
    CJoyEdit*   m_password;
	

	//##ModelId=44C4B5E402EF
    CJoyButton* m_btnCancel;
	//##ModelId=44C4B5E402F4
    CJoyButton* m_btnOK;

	//##ModelId=44C4B5E402FE
	CJoyCheckBox *m_throughProxyCheckBox;
	//##ModelId=44C4B5E40303
	CJoyCheckBox *m_NeedAuthCheckBox;

	//##ModelId=44C4B5E4030D
    bool m_bThroughProxy;
	//##ModelId=44C4B5E4030E
	bool m_bNeedAuth;
	  
	//##ModelId=44C4B5E4031C
	virtual void OnCheckNeedAuth(CJoyCheckBox* box, bool& checked);
	//##ModelId=44C4B5E40320
    virtual void OnCheckThroughProxy(CJoyCheckBox* box, bool& checked);
	//##ModelId=44C4B5E4032F
    virtual void CM_EditChar(CJoyEdit* pEdit, UINT nChar, bool& bPass);
	//##ModelId=44C4B5E4034B
    virtual void CM_Draw(Graphics& graph);
	//##ModelId=44C4B5E4034E
    virtual void CM_CancelClick(CJoyButton*);
	//##ModelId=44C4B5E4035C
    virtual void CM_OkClick(CJoyButton*);
	//##ModelId=44C4B5E4036B
    virtual void CM_LoadSkin(CJoyXmlElement* pSkinElem);
	//##ModelId=44C4B5E4036E
	void SaveProxyInfo();
	//##ModelId=44C4B5E4037A
	void LoadProxyInfo();

public:
   

	//##ModelId=44C4B5E4037B
    CJoyProxyWnd(void);
	//##ModelId=44C4B5E4038A
    virtual ~CJoyProxyWnd(void);

	//##ModelId=44C4B5E4038D
    void OnCancel();
public:
    DECLARE_MESSAGE_MAP()
	//##ModelId=44C4B5E4038E
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	//##ModelId=44C4B5E4039B
    afx_msg LRESULT OnNcHitTest(CPoint point);
	//##ModelId=44C4B5E4039E
    afx_msg void OnDestroy();
   
};

//##ModelId=44C4B5E403A9
class CJoyProxyDlg : public CDialog
{
	DECLARE_DYNAMIC(CJoyProxyDlg)

protected:
  

public:

	//##ModelId=44C4B5E403BB
	CJoyProxyWnd  m_ProxyWnd;
	//##ModelId=44C4B5E403BF
	CJoyProxyDlg(CWnd* pParent);   // standard constructor
	//##ModelId=44C4B5E403C9
	virtual ~CJoyProxyDlg();

  

// Dialog Data
	enum { IDD = IDD_JOYSETTINGDLG };

protected:
	//##ModelId=44C4B5E403CB
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
public:
	//##ModelId=44C4B5E403CE
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	//##ModelId=44C4B5E403D9
    afx_msg void OnSize(UINT nType, int cx, int cy);
	//##ModelId=44C4B5E403DE
    afx_msg LRESULT OnNcHitTest(CPoint point);
	//##ModelId=44C4B5E50000
    afx_msg void OnClose();
};


#endif  // __PROXYWND_H_CLIENT_MAIN__
